package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.ZrkParameters;
import io.finer.erp.jeecg.bas.mapper.ZrkParametersMapper;
import io.finer.erp.jeecg.bas.service.IZrkParametersService;
import org.springframework.stereotype.Service;
import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 复合参数表
 * @Author: jeecg-boot
 * @Date:   2020-10-24
 * @Version: V1.0
 */
@Service
public class ZrkParametersServiceImpl extends ServiceImpl<ZrkParametersMapper, ZrkParameters> implements IZrkParametersService {
	
	@Autowired
	private ZrkParametersMapper zrkParametersMapper;
	
	@Override
	public List<ZrkParameters> selectByMainId(String mainId) {
		return zrkParametersMapper.selectByMainId(mainId);
	}

	@Override
	public ZrkParameters getByProcessCode(String processCode) {
		LambdaQueryWrapper<ZrkParameters> query = new LambdaQueryWrapper<>();
		query.eq(ZrkParameters::getProcessCode, processCode);
		List<ZrkParameters> list = list(query);
		if(null != list && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}
}
